﻿using System;
using UnityEngine;

// Token: 0x020002B7 RID: 695
public class CautionScene : Scene
{
	// Token: 0x06001192 RID: 4498 RVA: 0x00071D8C File Offset: 0x0006FF8C
	private void Start()
	{
		base.InScene(false);
		ScreenFade.StartFade(ScreenFade.TYPE.IN, base.GC.FadeColor, this.fadeInTime, 0f, null, true);
		this.isFirstFrame = true;
		if (this.bgm.Length > 0)
		{
			base.GC.audioCtrl.BGM_LoadAndPlay(this.bgm, false, false);
		}
		this.rigids = this.explosionTrans.GetComponentsInChildren<Rigidbody>();
	}

	// Token: 0x06001193 RID: 4499 RVA: 0x00071E00 File Offset: 0x00070000
	private void Update()
	{
		if (this.isFirstFrame)
		{
			this.isFirstFrame = false;
			return;
		}
		if (this.GetInput() && !this.broken)
		{
			this.Break();
			base.GC.ChangeScene(this.nextScene, this.nextMessage, this.fadeOutTime);
		}
	}

	// Token: 0x06001194 RID: 4500 RVA: 0x00071E5C File Offset: 0x0007005C
	private void Break()
	{
		if (this.explosionTrans == null)
		{
			this.explosionTrans = base.transform;
		}
		for (int i = 0; i < this.rigids.Length; i++)
		{
			this.rigids[i].isKinematic = false;
			this.rigids[i].AddExplosionForce(this.explosionForce, this.explosionTrans.position, this.explosionRadius);
		}
		this.broken = true;
	}

	// Token: 0x06001195 RID: 4501 RVA: 0x00071ED8 File Offset: 0x000700D8
	private bool GetInput()
	{
		return Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Escape);
	}

	// Token: 0x04001363 RID: 4963
	public string nextScene = "LogoScene";

	// Token: 0x04001364 RID: 4964
	public string nextMessage = string.Empty;

	// Token: 0x04001365 RID: 4965
	public float fadeInTime = 1f;

	// Token: 0x04001366 RID: 4966
	public float fadeOutTime = 1f;

	// Token: 0x04001367 RID: 4967
	public string bgm = string.Empty;

	// Token: 0x04001368 RID: 4968
	private bool isFirstFrame = true;

	// Token: 0x04001369 RID: 4969
	private Rigidbody[] rigids;

	// Token: 0x0400136A RID: 4970
	[SerializeField]
	private Transform explosionTrans;

	// Token: 0x0400136B RID: 4971
	[SerializeField]
	private float explosionForce = 1f;

	// Token: 0x0400136C RID: 4972
	[SerializeField]
	private float explosionRadius = 1f;

	// Token: 0x0400136D RID: 4973
	private bool broken;
}
